package cn.wolfcode.es.domain;


import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@NoArgsConstructor
@AllArgsConstructor
@Document(indexName="es_shop", type="shop_product")
public class Product {
    @Id
    private String id;

    @Field(analyzer="ik_smart",searchAnalyzer="ik_smart",type = FieldType.Text)
    private String title;

    private Integer price;

    @Field(analyzer="ik_smart",searchAnalyzer="ik_smart",type = FieldType.Text)
    private String intro;

    @Field(type=FieldType.Keyword)
    private String brand;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id=id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title=title;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price=price;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro=intro;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand=brand;
    }
}